\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{MXResume}[2011/10/04 Resume package for Xin Meng]


\RequirePackageWithOptions{MXCommon}


\reversemarginpar

\RequirePackage[utopia]{mathdesign}


\setlength{\hoffset}{0cm}
\setlength{\voffset}{-0.5in}
\setlength{\textwidth}{11.5cm}%12cm}
\setlength{\textheight}{23.5cm}
\setlength{\oddsidemargin}{4.5cm}
\setlength{\marginparwidth}{\oddsidemargin}
\addtolength{\marginparwidth}{-1cm}
\setlength{\marginparsep}{5mm}

\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\footskip}{1cm}

\newlength{\totalresumewidth}
\addtolength{\totalresumewidth}{\textwidth}
\addtolength{\totalresumewidth}{\marginparwidth}
\addtolength{\totalresumewidth}{\marginparsep}

\newlength{\negtiveindent}
\addtolength{\negtiveindent}{-\marginparwidth}
\addtolength{\negtiveindent}{-\marginparsep}


\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\rfoot{\thepage}



\titleformat{\section}
{\bf\huge} % format
{} % label
{0mm} % sep
{} % before
{\normalfont} % after

\titlespacing{\section}
{\negtiveindent}
{1.5em}
{.5ex}


\titleformat{\subsection}
{\bf\large}
{}
{0mm}
{}
{\normalfont\normalsize}
\titlespacing{\subsection}
{0mm}
{2em}
{0mm}

\titleformat{\subsubsection}
{\bf}
{}
{0mm}
{}
{\normalfont\normalsize}
\titlespacing{\subsubsection}
{0mm}
{1em}
{0mm}



\newenvironment{resumeitem}
               {%\begin{small}
                   \begin{list}{$\bullet$}{
                       \setlength{\topsep}{0mm}
                       \setlength{\partopsep}{0mm}
                       \setlength{\itemsep}{0pt}
                       \setlength{\parsep}{0pt}
                       \setlength{\leftmargin}{10mm}%3mm}
                       \setlength{\rightmargin}{0mm}
                       \setlength{\itemindent}{0mm}
                       \setlength{\labelwidth}{5mm}
                       \setlength{\labelsep}{1mm}
                       \setlength{\listparindent}{0mm} 
                     }
               }
               {
                   \end{list}
                 %\end{small}
               }


\newcommand{\whenwhatwhere}[3]{\marginnote{\footnotesize\mbox{#1}\\\mbox{#2}\\\mbox{#3}}[-1.7em]}
%% \newcommand{\project}[1]{\vspace{2em}\large\textbf{#1}\refstepcounter{subsection}
%%     \addcontentsline{toc}{subsection}{#1}\normalfont}
\newcommand{\project}[1]{\subsection{#1}}


%\newcommand{\role}[1]{\vspace{1ex}\hspace{7mm}\small\textbf{Role:~#1}\normalfont}
\newcommand{\role}[1]{\subsubsection{Role:~#1}}



\newcommand{\myname}{Xin Meng}
\newcommand{\displayname}{\textbf{\fontsize{28}{25}\selectfont{\myname}}}
\newlength{\namewidth}
\settowidth{\namewidth}{\displayname}

\newcommand{\myphoto}{dummy}
\newcommand{\displayphoto}[1]{
  \ifthenelse{\equal{#1}{dummy}}
             {\fbox{\textcolor{white}{\rule{30mm}{40mm}}}}
             {\includegraphics[width=30mm, height=40mm]{#1}}
}
\newcommand{\myemail}{xxxxxxxxxxxxxxxxxx}
\newcommand{\myphone}{00000000000000000}
\newcommand{\myaddress}{Line 1 \\ 
  Line 2 \\
  Line 3 \\
  Line 4 
}

\newcommand{\photoandname}{
  \setlength{\parindent}{\negtiveindent}
  \begin{minipage}{\totalresumewidth}
    \displayphoto{\myphoto}
    \hspace{1em}
    \begin{minipage}[b]{\namewidth}
      \vspace{5pt}
      \displayname{}\refstepcounter{chapter}
    \addcontentsline{toc}{chapter}{\myname}\normalfont
      \vspace{10pt}

      \begin{footnotesize}
        \begin{tabular}{l@{ : }l}
          Email  & \myemail\\
          Phone  & \myphone \\
          Address & 
          \begin{minipage}[t]{\textwidth}
            \myaddress
          \end{minipage}\\
        \end{tabular}
      \end{footnotesize}
    \end{minipage}
  \end{minipage}

  \vspace{1ex}

  \hypersetup{%
    pdftitle={\myname{} resume},
    pdfauthor={\myemail},
    pdfsubject={\myname{} resume},
    pdfkeywords={\myname{}, \myemail{}}
  }

  \rule{\totalresumewidth}{1pt}\\
  \vspace{2em}
  \setlength{\parindent}{0mm}
}

\hypersetup{
  bookmarksopen={true}
}



\newcommand{\zju}{Zhejiang University}









